1. Field of the Invention
The present invention relates to a data protecting system for external storage medium for use with an information processing unit, in particular, to a data protecting system for exchangeable storage medium.
2. Description of the Related Art
A large number of floppy disks (exchangeable storage mediums) which are less expensive and more portable than hard disks are used for personal computers, workstations, office computers, and the like as data storage mediums, software distribution mediums, and so forth.
In recent years, optomagnetic disks, IC memory cards, and the like have been used as exchangeable storage mediums. Information processing units are usually provided with a drive device corresponding to an exchangeable storage medium. Files created on such a medium are accessed through the drive device.
Exchangeable storage mediums such as floppy disks are superior to other mediums in portability. However, since the users can remove a floppy disk from the drive device at any time, data of files stored on the disk may be easily destroyed unless the disk is correctly handled. In other words, if a floppy disk is removed from the drive device, while data of a file on the disk is being executed, the data may be destroyed or may not be accessed later because the file is not properly closed.
To solve such a problem, so far, the following countermeasures were taken.
When a medium is initialized, intrinsic information is written to a predetermined sector of a predetermined track of a storage medium (normally, the first sector of the first track of the storage medium). When the storage medium is removed from the drive device, the intrinsic information is stored in a memory of the information processing unit. When a storage medium is mounted in the drive device, intrinsic information of this storage medium is read. The information processing unit compares the intrinsic information of the storage medium with the intrinsic information stored in the memory. Only when they match, the information processing unit allows the storage medium inserted in the drive device to be accessed.
In such a construction, even if a storage medium is removed while it is open (namely, in an I/O accessible state), when another storage medium is inserted in the drive device, data on this storage medium is not destroyed. In addition, the file on the storage medium which was opened can be correctly closed.
However, in the above-described conventional data protecting system for exchangeable storage mediums has the following drawbacks 1 to 5.
1 When a storage medium which was initialized by an information processing unit which does not have such a data protecting function is removed from a drive device thereof, the storage medium can no longer be used. This is because predetermined intrinsic information has not been written in a predetermined area of the storage medium. Thus, once the storage medium is removed from the drive device, an information processing unit with such a data protecting function will detect a disk error.
2 To allow a storage medium on which intrinsic information has not been written to be used in the unit with such a data protecting function, the storage medium should be initialized by this unit. However, when the storage medium is initialized by the unit, all data stored on the storage medium will be erased. To prevent that, the data should be saved on another storage medium. Thereafter, the saved data should be stored on the storage medium which was initialized by the system. Although such troublesome operations may be performed by a utility program, however, the operation of the program is also troublesome. When such a program is not available, it should be newly created with large labor costs.
3 When a data input/output request is performed for a storage medium, before a process for the request has been completed, if the storage medium is removed from the drive device, the data which was I/O requested will be lost. Thus, an application program should issue a data I/O request again to the operating system (OS) of the unit. To do that, however, the application program should receive information with respect to data I/O requests which were performed before the storage medium was removed from the OS. Nevertheless, conventional OS do not have such a function and thereby the acquisition of such information is almost impossible.
4 If intrinsic information cannot be correctly read from a storage medium (namely, if an I/O error takes place) or if a storage medium to be inserted in a drive device is lost, queued I/O requests performed for the storage medium cannot be cleared. To cancel the I/O requests, the unit should be turned off and then turned on again. Thus, the user should perform troublesome operations.
5 Although a drive device has a mechanism which electrically detects whether a storage medium is inserted or removed, while the drive device is turned off, of course, such a detecting mechanism does not work and thereby the drive device cannot detect an insertion and a removal of the storage medium.
Thus, when a storage medium has been inserted in a drive device, if its power is stopped, this storage medium can be replaced with another storage medium. In the conventional data protecting system, when a storage medium has been inserted and it is in an operable state as a file system in the unit, the drive device can be turned off.
Thus, in an information processing unit having for example a resume function, when a storage medium inserted in a drive device is in an operable state as a file system in the unit, after the power of the drive device is stopped and then the storage medium is replaced with another storage medium, if the power to the drive device is resumed, management information of the storage medium which was inserted in the drive device and which is managed by the OS does not match the management information of the storage medium which is currently inserted. If a data I/O process is performed for the storage medium which is currently inserted in the drive device, data stored on the storage medium which was inserted in the drive device may be destroyed.
In addition, while a storage medium which is inserted in a drive device is in an I/O accessible state (namely, a file on the storage medium is open), if the storage medium is replaced, as with the above case, due to the resume function, data stored on a storage medium newly inserted in the drive device may be destroyed.